home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Risc World 5
/
Risc World 5.iso
/
SOFTWARE
/
Issue5
/
PD
/
DIRSYNC
/
LegalStuff
/
ccres
/
Bin
/
CleanMakeFile
Wrap
Makefile
|
2003-12-09
|
1KB
|
43 lines
100 REM > CleanMakeFile
200 REM Removes the dynamic dependencies in RISC OS makefiles
300 REM (i.e. removes all the data after the "# Dynamic dependencies:" line).
400 REM
500 REM Written by John Tytgat <John.Tytgat@aaug.net>
600 REM GNU Public License
700 :
800 FileHandle% = 0
900 ON ERROR ON ERROR OFF:PROCError:END
1000 :
1100 SYS "OS_GetEnv" TO A$
1200 Offset% = INSTR(A$, " -file")
1300 IF Offset% = 0 THEN
1400 PRINT "Missing ""-file <filename>"" argument"
1500 END
1600 ENDIF
1700 MakeFileName$ = MID$(A$, Offset% + 7)
1800 :
1900 FileHandle% = OPENUP(MakeFileName$)
2000 IF FileHandle% = 0 THEN ERROR 1, "Can't open RISC OS Makefile <"+MakeFileName$+">"
2100 :
2200 CleanedUp% = FALSE
2300 WHILE NOT(EOF#FileHandle%) AND NOT(CleanedUp%)
2400 aLine$ = GET$#FileHandle%
2500 IF aLine$ = "# Dynamic dependencies:" THEN
2600 EXT#FileHandle% = PTR#FileHandle%
2700 CleanedUp% = TRUE
2800 ENDIF
2900 ENDWHILE
3000 CLOSE#FileHandle%:FileHandle% = 0
3100 :
3200 IF NOT(CleanedUp%) THEN
3300 PRINT "There was nothing to clean up in the file <";MakeFileName$;">"
3400 ENDIF
3500 END
3600 :
3700 DEF PROCError
3800 PRINT "ERROR: ";REPORT$;" at line ";ERL
3900 IF FileHandle% <> 0 THEN
4000 CLOSE#FileHandle%:FileHandle% = 0
4100 ENDIF
4200 ENDPROC